##
# Makefile de génération du tutoriel en plusieurs formats
#

PROJECT_NAME=django-tutoriel

help:
	@echo "Please use \`make <target>' where <target> is one of"
	@echo "  html      to make standalone HTML files"
	@echo "  latex     to make LaTeX files"
	@echo "  zcode     to make a zcode file"

clean: clean-html clean-latex clean-zcode

clean-html:
	rm -fr html/

clean-zcode:
	rm -fr zcode/

clean-pdf:
	rm -fr latex/*.out
	rm -fr latex/*.aux
	rm -fr latex/*.log

clean-latex: clean-pdf
	rm -fr latex/*.tex

html: intro.text share/header.html share/footer.html
	mkdir -p html/
	mdown $(MDNFLAGS) -H share/header.html -F share/footer.html -o html/$(PROJECT_NAME).html -f xhtml $<

zcode: intro.text
	mkdir -p zcode/
	mdown $(MDNFLAGS) -o zcode/$(PROJECT_NAME).zcode -f zcode $<

latex: intro.text share/header.tex share/footer.tex
	mkdir -p latex/
	mdown $(MDNFLAGS) -H share/header.tex -F share/footer.tex -o latex/$(PROJECT_NAME).tex -f latex $<
